import request from '@/utils/request'

export function login(data) {
  // 用 axios 请求
  return request({ // axios 调用的结果是 promise 对象
    method: 'post',
    url: '/sys/login',
    data
  })
}

export function postUserInfo() {
  return request({
    url: '/sys/profile',
    method: 'post'
  })
}

export function getUserDetailById(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'get'
  })
}
